package com.xzakota.minesweeper.model.entity;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 房间实体类
 *
 * @author Xzakota
 */
public class RoomBean implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    public int num;

    public int roomCurrentOnline = 0;
    public int roomMaxOnline = 4;

    public int roomLevel = -1;

    public RoomBean(int num) {
        this.num = num;
    }

    public RoomBean(int num, int roomLevel) {
        this.num = num;
        this.roomLevel = roomLevel;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RoomBean roomBean = (RoomBean) o;
        return num == roomBean.num && roomCurrentOnline == roomBean.roomCurrentOnline && roomMaxOnline == roomBean.roomMaxOnline && roomLevel == roomBean.roomLevel;
    }

    @Override
    public int hashCode() {
        return Objects.hash(num, roomCurrentOnline, roomMaxOnline, roomLevel);
    }

    @Override
    public String toString() {
        return "RoomBean{" +
                "num=" + num +
                ", roomCurrentOnline=" + roomCurrentOnline +
                ", roomMaxOnline=" + roomMaxOnline +
                ", roomLevel=" + roomLevel +
                '}';
    }
}
